package cn.aicnn.chatssespringboot.service;

import cn.aicnn.chatssespringboot.dto.AIAnswerDTO;
import cn.aicnn.chatssespringboot.vo.newQuestionResponseVO;
import cn.aicnn.chatssespringboot.vo.newQuestionVO;
import cn.aicnn.chatssespringboot.vo.streamQuestionResponseVO;
import com.fasterxml.jackson.core.JsonProcessingException;
import org.springframework.http.codec.ServerSentEvent;
import org.springframework.stereotype.Service;
import reactor.core.publisher.Flux;

import java.io.IOException;

@Service
public interface GptService {
    Flux<ServerSentEvent<AIAnswerDTO>> doChatGPTStream(int chatId,String requestQuestion);
    Flux<ServerSentEvent<AIAnswerDTO>>  handleWebClientResponse(String resp);
    void addNewMessage();
    String doChatGPTBlock(String question,int type);
    Object newQuestion(newQuestionVO request) throws IOException, InterruptedException;
    Object ask(newQuestionVO request, int chatid) throws IOException, InterruptedException;
    //流式或者阻塞传输的方法
    Object askByStream(int chatId,String question);
    Object newQuestionByStream(String userid,String question) throws IOException, InterruptedException ;
    //天气查询方法
    Object askByWeather(String question);
    String aiPainting(String promot) throws IOException, InterruptedException;
}
